#include <iostream>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
using namespace std;
using ll=long long;

vector<string> ret;
int main()
{
	string str;
	getline(cin,str);
	string tmp;
	for(int i=0;i<str.size();i++)
	{
		if(str[i]>='0' && str[i]<='9')
		{
			tmp+=str[i];
		}
		else if(tmp.size())
		{
			string s;
			int tp=0;
			while(tp<tmp.size() && tmp[tp]==0)
				tp++;
			for(int zz=tp;zz<tmp.size();zz++)
			{
				s+=tmp[zz];
			}
			ret.push_back(s);
			tmp="";
			
		}
	}
	if(tmp.size())
		ret.push_back(tmp);
	
	if(ret.size()==0)
	{
		cout<<0<<endl;
	}
	else{
		sort(ret.begin(),ret.end(),[](const string& s1,const string& s2){
			int p1=0,p2=0;
			while(p1<s1.size() && s1[p1]==0)
			{
				p1++;
			}
			while(p2<s2.size() && s2[p2]==0)
			{
				p2++;
			}	
			string t1,t2;
			for(int i=p1;i<s1.size();i++)
				t1+=s1[i];
			for(int i=p2;i<s2.size();i++)
				t2+=s2[i];
			if(t1.size()==t2.size())
			{
				return t1<t2;
			}		
			else if(t1.size()<t2.size()){
				return true;
			}
			else if(t1.size()>t2.size())
			{
				return false;
			}
			
		});
		cout<<ret[0];
		for(int i=1;i<ret.size();i++)
		{
			cout<<','<<ret[i];
		}
	}
	
	return 0;
}
